<?php

namespace App\Http\Controllers\Api\v1;

use App\Http\Requests\Api\v1\ComplaintRequest;
use App\Models\Complaint;
use App\Models\User;
use Illuminate\Http\Request;

/**
 * 投诉举报
 * @package App\Http\Controllers\Api
 */
class ComplaintController extends Controller
{
    public function store(ComplaintRequest $request)
    {
        $user = User::getUser(['tiktokid'=>$request->header('Userid')]);
        $data = $request->only(['content']);
        $data['type'] = 'complaint';
        $user->complaints()->create($data);
        return $this->success();
    }
}
